﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Text;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        load_zpData();
        load_gdData();
        load_bydtImgData();
        load_bydtData();
        load_hydtImgData();
        load_hydtData();
        //load_marqueeImgData();
        load_switchImgData();
    }
    void load_zpData()
    {
        String sql = "select top 2  title,addDate,img,content,newId from news where channelid in (select channel_id from channel where pageLocation='jcal') order by addDate desc";

        DB.bindData(sql, zpData);
    }
    void load_gdData()
    {
        String sql = "select top 7  title,newId from news where channelid in (select channel_id from channel where pageLocation='gd') order by addDate desc";

        DB.bindData(sql, gdData);
    }
    void load_bydtImgData()
    {
        String sql = "select top 1  title,newId,addDate,img from news where img<>'' and channelid in (select channel_id from channel where pageLocation='bydt') order by addDate desc";

        DB.bindData(sql, bydtImgData);
    }
    void load_bydtData()
    {
        String sql = "select top 5  title,newId,addDate,img from news where channelid in (select channel_id from channel where pageLocation='bydt') order by addDate desc";

        DB.bindData(sql, bydtData);
    }
    void load_hydtImgData()
    {
        String sql = "select top 1  title,newId,addDate,img from news where img<>'' and channelid in (select channel_id from channel where pageLocation='hydt') order by addDate desc";

        DB.bindData(sql, hydtImgData);
    }
    void load_hydtData()
    {
        String sql = "select top 5  title,newId,addDate,img from news where channelid in (select channel_id from channel where pageLocation='hydt') order by addDate desc";

        DB.bindData(sql, hydtData);
    }
    /*void load_marqueeImgData()
    {
        String sql = "select top 20  img from news where channelid in (select channel_id from channel where pageLocation='marqueeImg') order by addDate desc";

        DB.bindData(sql, marqueeImgData);
    }*/
    void load_switchImgData()
    {
        String sql = "select  tourl,img,title from news where channelid in (select channel_id from channel where pageLocation='switchImg') order by addDate";

        DB.bindData(sql, switchImgData);
    }
}
